package com.easyui_server.model;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.solution.framework.model.BaseBean;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;

/**
 * Created with generator tools.
 * User: sunguangzhu
 * DateTime:2014-02-19 05:00:53
 */
@Entity
@Table(name = "t_user")
public class User extends BaseBean implements java.io.Serializable {

    /**
     * 名称
     */
    private String name;

    /**
     * 头像
     */
    private String head;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 身高
     */
    private Double height;

    /**
     * 出生日期
     */
    private java.sql.Date borthDate;

    /**
     * 所属组别
     */
    private com.easyui_server.model.Group group;

    /**
     * default constructor
     */
    public User() {
    }

    /**
     * full constructor
     *
     * @param name
     * @param head
     * @param age
     * @param height
     * @param borthDate
     * @param group
     */
    public User(String name, String head, Integer age, Double height, java.sql.Date borthDate, com.easyui_server.model.Group group) {
        this.name = name;
        this.head = head;
        this.age = age;
        this.height = height;
        this.borthDate = borthDate;
        this.group = group;
    }

    /**
     * getter
     */
    @Column
    public String getName() {
        return this.name;
    }

    /**
     * setter
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * getter
     */
    @Column
    public String getHead() {
        return this.head;
    }

    /**
     * setter
     *
     * @param head
     */
    public void setHead(String head) {
        this.head = head;
    }

    /**
     * getter
     */
    @Column
    public Integer getAge() {
        return this.age;
    }

    /**
     * setter
     *
     * @param age
     */
    public void setAge(Integer age) {
        this.age = age;
    }

    /**
     * getter
     */
    @Column
    public Double getHeight() {
        return this.height;
    }

    /**
     * setter
     *
     * @param height
     */
    public void setHeight(Double height) {
        this.height = height;
    }

    /**
     * getter
     */
    @Column
    public java.sql.Date getBorthDate() {
        return this.borthDate;
    }

    /**
     * setter
     *
     * @param borthDate
     */
    public void setBorthDate(java.sql.Date borthDate) {
        this.borthDate = borthDate;
    }

    /**
     * getter
     */
    @JsonManagedReference
    @ManyToOne(fetch = FetchType.EAGER)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "group_id")
    public com.easyui_server.model.Group getGroup() {
        return this.group;
    }

    /**
     * setter
     *
     * @param group
     */
    public void setGroup(com.easyui_server.model.Group group) {
        this.group = group;
    }

}
